<div class="sidebar_block">

        <h3><?=$event->title;?></h3>
        <span><em><?=date('d/m/Y', strtotime($event->date));?> (<?=$event->event_time;?>)</em></span><br />
        <span class='eventCol'>Locatie:</span> <span class='eventCol2'><?=$event->place;?></span><br />
        <span class='eventCol'>Schade:</span> <span class='eventCol2'><?=$event->damage;?>3</span><br />
	
    	<span class='eventCol'>Attending:</span><span class='eventCol2'>
        
        <? $attend = false; ?>

        <? $participants = $this->EventsModel->getParticipants($event->id); ?>
        <? foreach ($participants as $participant): // zet de  variabele $attend op true als de participant al aangemeld is. //> (kruisje weergeven bij naam.) ?>
			
            <? if ($participant->id == $this->tank_auth->get_user_id() ){ $attend=true; $my_weight = $participant->weight; echo "<span class='participant'>"; } ?>

            <a class="fancy_box" href="<?=base_url(); ?>profile/<?=$participant->user_id;?>"><?=$participant->display_name;?></a>
			<? 
			if ($participant->weight > 0){ 
				echo "+" . $participant->weight;
			}
            if ($participant->id == $this->tank_auth->get_user_id()){ 
                echo "<a class='remove_participant' id='" .  $event->id . "'></a></span>";
			}
			?>

		<? endforeach;?>    
        </span>
        <br /><br /><br />
        <span class='messages'><?=$this->EventsModel->countMessages($event->id)?> berichten</span>
        
		<? if ($attend==true && $my_weight < 9){  //Als de persoon attending is, optie +1 geven ?>
		 <em> <a class='up_weight' id='<?=$event->id?>'> <img src="images/layout/icon_plus.png"/><?=$my_weight+1?></a></em>
		<? }else if ($attend==false){ // persoon is nog niet attending. Optie 'kom ook' geven ?>
		 <em> <a class="add_participant" id='<?=$event->id?>'><img src="images/layout/icon_plus.png"/>Ik kom ook</a></em>
        <? } 
		$attend=false; ?>
        <img class='event_spacer' src='images/layout/event_spacer.png' />
        </div>
        
